import java.util.Scanner;

public class demo017 {
    public static void main(String[] args) {
        Scanner scan= new Scanner(System.in);

        char[] arr=new char[9999];

        int k=0;
        while(true) {
            System.out.println("请输入一个字母");
            char a=scan.next().charAt(0);
            if(a=='N') {
                break;
            }
            else {
                if(a>64&&a<91) {
                    arr[k]=a;
                    k++;
                }
                else {
                    System.out.println("你输入的不为大写字母，请重新输入");
                }
            }
        }
        for(int i=0;i<=k;i++) {
            System.out.println(arr[i]);
        }
    }
}
